package com.ts.api.module.channel.service;

import com.ts.api.module.channel.entity.bo.ChannelRegisterFieldBO;
import com.ts.api.module.channel.entity.bo.ChannelUserBO;
import com.ts.api.module.channel.entity.po.ChannelUserRegisterPO;
import com.ts.api.module.channel.entity.qo.ChannelUserQO;

import java.util.List;

/**
 *  用户业务层
 */
public interface ChannelUserService {

    /**
     *  根据手机号获取用户对象
     *
     *  @param  channelUserQO   查询对象
     *  @return ChannelUserRegisterPO
     */
    ChannelUserRegisterPO get(ChannelUserQO channelUserQO);

    /**
     *  右匹配手机号(模糊查询)
     *
     *  @param  channelUserQO   查询对象
     *  @return List
     */
    List<ChannelUserRegisterPO> listRightMatchPhone(ChannelUserQO channelUserQO);

    /**
     *  插入用户
     *
     *  @param  channelUserRegisterPO
     *  @return ChannelUserRegisterPO
     */
    ChannelUserRegisterPO insert(ChannelUserRegisterPO channelUserRegisterPO);

    /**
     *  用户注册
     *
     *  @param  smsCode          短信验证码
     *  @param  registerFieldBO
     *  @return ChannelCacheUser
     */
    ChannelUserBO register(String smsCode, ChannelRegisterFieldBO registerFieldBO, boolean isThrows);

    /**
     *  用户更新
     *
     *  @param userRegisterPO
     *  @return
     */
    int update(ChannelUserRegisterPO userRegisterPO);

    /**
     *  根据手机号MD5查询总数
     *
     *  @param phoneMd5 手机号md5
     *  @return int
     */
    int countByPhoneMd5(String phoneMd5);

    /**
     *  是否本地库存在
     *
     *  @param  phoneMd5    手机号md5
     *  @return boolean
     */
    boolean hasLocalExist(String phoneMd5);
}
